//
//  HomeCardChatViewModel.swift
//  MoyoungHome
//
//  Created by 易先生 on 2022/9/26.
//

import UIKit
import Charts
import RxCocoa
import RxSwift
import SwiftDate

open class HomeCardChatViewModel: NSObject {

    public var defaultValue:Double = 0.0
    public var dataSource:[Double] = []
    public var maxValue:Double = 50

    /// 获取x轴的格式器
    open func getXAxisValueFotmatter() ->IAxisValueFormatter{
        return DayAxisValueFormatter()
    }

    /// 获取x轴的数量
    open func getBarCount() -> Int{
        return dataSource.count
    }
    
    /// 获取最大值
    open func getBarMaxValue() -> Double{
        var maxValue:Double = maxValue
        if let tmpMax = self.dataSource.max(){
            maxValue = max(tmpMax, maxValue)
        }
        return maxValue
    }
    
    /// 获取最小值
    open func getBarMinValue() -> Double{
        return 0
    }

}
